1. Field of the Invention
The present invention relates to a method and device for determining whether or not an origin return operation is required upon resupplying of power after power cut-off during operation of an industrial robot such as an arc welding robot.
2. Description of the Prior Art
Generally, in controlling an industrial robot such as an arc welding robot, it is necessary to detect a rotational angle of each rotating axis (movable portion) of arms or the like of the robot with a high accuracy. Further, it is desired that an absolute rotational angle of each rotating axis can be detected without carrying out an origin return operation upon resupplying of power after power cut-off.
There has been conventionally proposed a rotational angle detecting device as shown in FIG. 11. Referring to FIG. 11, the rotational angle detecting device includes an arm 1 of the industrial robot, a rotating axis 1a of the arm 1, a speed reducer 2, a motor 3 for rotationally driving the arm 1 via the speed reducer 2, a resolver 4 connected via the speed reducer 2 and the motor 3 to the rotating axis 1a of the arm 1 for detecting an absolute rotational angle (.theta.) within a predetermined rotational angle (e.g., one revolution or 360.degree.). Also provided are a driver 5 for exciting the resolver 4, a resolver/digital (R/D) converter 6 for converting a detection signal from the resolver 4 into a digital signal, and a resolver/pulse (R/P) converter 7 for pulsing the detection signal from the resolver 4 and for converting the same into incremental signals having A, B and Z phases. The pulse signal having the Z phase is used for setting an origin, and the pulse signals having the A and B phases are output with a phase difference of 90.degree., so that a rotational direction is detected by checking a priority relationship between these pulse signals.
Reference numeral 8 designates an updown counter for counting the pulse signals having the A and B phases from the R/P converter 7 to output an absolute rotational angle within one revolution of the motor 3 divided into 256 with 8 bits by using low-order bits 2.sup.0 to 2.sup.7, while counting carry and borrow signals of 2.sup.7 corresponding to one revolution of the motor 3 to output an absolute revolution number by using high-order bits 2.sup.8 to 2.sup.15. Reference numeral 9 designates a first memory for storing a count value from the low-order bits 2.sup.0 to 2.sup.7 of the updown counter 8 receiving the detection signal (the absolute rotational angle within one revolution) from the resolver 4 at the timing of power cut-off. Reference numeral 10 designates a second memory for storing a count value from the high-order bits 2.sup.8 to 2.sup.15 of the updown counter 8 at the timing of power cut-off. Reference numeral 11 designates a comparator for comparing an actual detection signal from the resolver 4 digitized by the R/D converter 6 upon resupplying of power with the detection signal stored into the first memory upon power cut-off. Reference numeral 12 designates a corrector for correcting the count value stored into the second memory 10 upon power cut-off to an actual count value corresponding to an actual absolute revolution number according to a result of a comparison from the comparator 11 (which will be hereinafter described in detail) and setting the corrected value into the high-order bits 2.sup.8 to 2.sup.15 of the updown counter 8.
The actual detection signal from the resolver 4 digitized by the R/D converter 6 upon resupplying of power is set into the low-order bits 2.sup.0 to 2.sup.7 of the updown counter 8. The first memory 9 and the second memory 10 are constructed of a non-volatile memory or a battery backup RAM.
In a normal detecting operation of a rotational angle, an origin return operation is first carried out, and a detection phase sin (.omega.t+.theta.) is output from the resolver 4 which has received an excitation phase (sin .omega.t, cos .omega.t) from the driver 5. From the detection phase, an absolute rotational angle .theta. within one revolution of the motor 3 is obtained, and the detection signal is pulsed by the R/P converter 7. Then, the pulse signals (A and B phases) are counted by the updown counter 8 to thereby output an absolute rotational angle within one revolution from the low-order bits 2.sup.0 to 2.sup.7 and also output an absolute revolution number of the motor 3 from the high-order bits 2.sup.8 to 2.sup.15. Thus, an absolute rotational angle of the motor 3 is detected as the sum of the absolute rotational angle within one revolution and (the absolute revolution number).times.360.degree..
Under the above condition where the rotational angle is detected once after carrying out the origin return operation, when the power of the device is cut off, the detection signal from the resolver 4 at the timing of power cut-off is stored into the first memory 9 as the count value from the low-order bits 2.sup.0 to 2.sup.7 of the updown counter 8. Simultaneously the count value from the high-order bits 2.sup.8 to 2.sup.15 is stored into the second memory 10. At this time, while the count value in the updown counter 8 is reset by the power cut-off, the contents stored in the memories 9 and 10 do not volatilize.
Further, when the power is turned off, the motor 3 is braked by a braking device (not shown) to hinder excess rotation at an angle greater than .+-.180.degree. even if an external force (e.g., gravity moment) is applied to the arm 1 until the power is turned on again. In this manner, if a difference in rotational angle of the motor 3 between upon power cut-off and upon resupplying of power is equal to or less than .+-.180.degree., the absolute rotational angle of the motor 3 can be corrected, as described below, thereby eliminating the need for an origin return operation.
That is, when the power is resupplied after power cut-off, a detection signal from the resolver 4 is digitized by the R/D converter 6, and it is newly set as an absolute rotational angle within one revolution upon resupplying of power into the low-order bits 2.sup.0 to 2.sup.7 of the updown counter 8. Simultaneously, the digital detection signal from the R/D converter 6 is input into the comparator 11. Then, the comparator 11 compares the actual detection signal from the resolver 4 with the detection signal upon power cut-off which signal is input from the first memory 9. The comparator 11 then outputs a correction command to the corrector 12 according to a difference between the actual detection signal from the resolver 4 and the detection signal from the first memory 9. If the result of the comparison in the comparator 11 [i.e., (the actual detection signal from the resolver 4)-(the detection signal from the first memory 9 upon power cut-off)] is in the range of -180.degree. to +180.degree., the correction command is not output. If the result is in the range of -360.degree. to -180.degree., the correction command is output to the corrector 12 so as to add 1 to the count value (the high-order bits 2.sup.8 to 2.sup.15) from the second memory 10 upon power cut-off. Similarly, if the result is in the range of 180.degree. to 360.degree., the correction command is also output to the corrector 12 so as to subtract 1 from the count value.
Accordingly, even if the motor 3 is rotated, by an external force during the power off state, past a zero detection point of the resolver 4, a revolution number of the motor 3 can be prevented from being miscounted upon resupplying of power. That is, after the count value stored in the second memory 10 upon power cut-off is corrected to an actual count value corresponding to an actual absolute revolution number including the rotation during the power off state by the comparator 11 and the corrector 12, the corrected count value is set into the high-order bits 2.sup.8 to 2.sup.15 of the updown counter 8.
Thus, even if the motor 3 is rotated during the power off state, the absolute rotational angle of the motor 3 upon resupplying of power can be accurately detected as an output from the updown counter 8 which is the sum of the absolute rotational angle within one revolution from the resolver 4 and (the corrected actual count value).times.360.degree.. Further, as far as the rotational angle of the motor 3 during the power off state does not exceed .+-.180.degree., the origin return operation upon resupplying of power is not required.
In the case where the power is turned off under a stop condition of the industrial robot, the attitude of the industrial robot is normally sufficiently retained by a braking force of the brake of the motor 3. Therefore, the further rotation of the motor 3 during the power off state is small due to, for example, play of the brake, and does not exceed .+-.180.degree.. Accordingly, the absolute rotational angle of the motor 3 is detected by the above conventional rotational angle detecting device without carrying out the origin return operation.
On the other hand, in the case where the power is turned off under the operating condition of the industrial robot such that the motor 3 is rotated at a speed less than a certain value, and a primary power supply is suddenly cut off (power failure), or an emergency stop button is operated, or an emergency stop condition due to abnormality (heavy abnormality) of a computer, servo, etc. is generated, the rotational angle of the motor 3 after power cut-off can be made within .+-.180.degree., and the information concerning the position data at this time can be stored into the memories 9 and 10. However, if the industrial robot is operated at a speed greater than the certain value upon power cut-off, it is difficult to stop the robot within a period of time until a CPU for controlling the robot is rendered inoperable because of the power cut-off.
In the above circumstances, it could be considered that when the power is turned off, such as by power failure during the operation of the robot, the origin return operation is necessarily carried out upon resupplying of power. However, the robot is actually often operated at a low speed to some extent and stopped upon power failure in a position range where the origin return operation is not required. Accordingly, if the origin return operation is carried out after solution of the power failure whenever the power failure occurs, an applicable proportion of the origin return operation elimination technique would be lowered, and the effect of the origin return operation elimination technique by the above-mentioned rotational angle detecting device could not be sufficiently obtained.